#import "MoreViewController.h"
#import "AppDelegate.h"
#import "MBProgressHUD.h"

@interface MoreViewController ()

@end

@implementation MoreViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
     
        NSLog(@"asdfdsf");
    }
    return self;
}

-(void)feedbackFn{
    SendSuggestUI*  ui=[[SendSuggestUI alloc] init];
    ui.hidesBottomBarWhenPushed=YES;
    [self.navigationController pushViewController:ui animated:NO];
}
-(void)aboutFn{
    AboutUI*  ui=[[AboutUI alloc] init];
    ui.hidesBottomBarWhenPushed=YES;
    [self.navigationController pushViewController:ui animated:NO];
}
-(void)pingfenFn{
    //[self.view makeToast:@"等发布后转向苹果商店的打分界面"];
    //给我评分
    
    NSString *urlStr;
    
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
        
        urlStr = @"itms-apps://itunes.apple.com/app/id1015519070";
        
    }
    
    else
    {
        
        urlStr=  @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=1015519070";
    }
    
    //                NSString *str = [NSString stringWithFormat:
    //                                 @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d",899155964];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    UILabel*  titleLb=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
    titleLb.text=@"更多";
    titleLb.textAlignment=NSTextAlignmentCenter;
    titleLb.textColor=[UIColor whiteColor];
    self.navigationItem.titleView=titleLb;
    self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"cat_bg.png"]];
    
    UIImage* icon=[UIImage imageNamed:@"yedian120"];
    UIImageView*  iconView=[[UIImageView alloc] initWithFrame:CGRectMake(130, 15, 60, 60)];
    iconView.image=icon;
    [self.view addSubview:iconView];
    
    UILabel*  yedianChinaLb=[[UILabel alloc] initWithFrame:CGRectMake(10, 80, 300, 20)];
    yedianChinaLb.text=@"夜店中国1.0";
    yedianChinaLb.textAlignment=NSTextAlignmentCenter;
    yedianChinaLb.textColor=[UIColor darkGrayColor];
    yedianChinaLb.font=[UIFont systemFontOfSize:14];
    [self.view addSubview:yedianChinaLb];
    NSLog(@"更多...");
    
    
    int  delta=15;
    UIImage* aoxian=[UIImage imageNamed:@"aoxian.png"];
    UIImageView* aoxianView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 100+delta, 320, 1.5)];
    aoxianView.image=aoxian;
    [self.view addSubview:aoxianView];
    
    UIView* bg=[[UIView alloc] initWithFrame:CGRectMake(0, 101.5+delta, 320, 120)];
    bg.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:bg];
    //
    UIButton* feedBackBtn=[[UIButton alloc] initWithFrame:CGRectMake(0, 101.5+delta, 320,38)];
    feedBackBtn.backgroundColor=[UIColor clearColor];
    [feedBackBtn addTarget:self action:@selector(feedbackFn) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:feedBackBtn];
    
    UILabel* feedBackLb=[[UILabel alloc] initWithFrame:CGRectMake(20,9, 80, 20)];
    feedBackLb.text=@"意见反馈";
    feedBackLb.textAlignment=NSTextAlignmentLeft;
    feedBackLb.textColor=[UIColor grayColor];
    [feedBackBtn addSubview:feedBackLb];
    
    UIImage* arrow=[UIImage imageNamed:@"关于_06.png"];
    UIImageView* arrowView=[[UIImageView alloc] initWithFrame:CGRectMake(280, 12, 10, 14)];
    arrowView.image=arrow;
    [feedBackBtn addSubview:arrowView];
    
    
    //
    aoxianView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 140+delta, 320, 1.5)];
    aoxianView.image=aoxian;
    [self.view addSubview:aoxianView];
    //
    UIButton* pingfenBtn=[[UIButton alloc] initWithFrame:CGRectMake(0,140+delta, 320, 38)];
    
    [pingfenBtn addTarget:self action:@selector(pingfenFn) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:pingfenBtn];
    
    UILabel* pingfenLb=[[UILabel alloc] initWithFrame:CGRectMake(20,9, 140, 20)];
    pingfenLb.text=@"给我们打分";
    pingfenLb.textAlignment=NSTextAlignmentLeft;
    pingfenLb.textColor=[UIColor grayColor];
    [pingfenBtn addSubview:pingfenLb];
    //
    arrowView=[[UIImageView alloc] initWithFrame:CGRectMake(280, 12, 10, 14)];
    arrowView.image=arrow;
    [pingfenBtn addSubview:arrowView];
    
    
    
    
    
    
    aoxianView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 180+delta, 320, 1.5)];
    aoxianView.image=aoxian;
    [self.view addSubview:aoxianView];
    
    
        
    
    
    
    
    
    UIButton* aboutBtn=[[UIButton alloc] initWithFrame:CGRectMake(0, 180+delta, 320, 38)];
    
    [aboutBtn addTarget:self action:@selector(aboutFn) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:aboutBtn];
    
    UILabel* aboutLb=[[UILabel alloc] initWithFrame:CGRectMake(20, 9, 90, 20)];
    aboutLb.text=@"关于我们";
    aboutLb.textAlignment=NSTextAlignmentLeft;
    aboutLb.textColor=[UIColor grayColor];
    [aboutBtn addSubview:aboutLb];
    
    arrowView=[[UIImageView alloc] initWithFrame:CGRectMake(280, 12, 10, 14)];
    arrowView.image=arrow;
    [aboutBtn addSubview:arrowView];

    
    
    aoxianView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 220+delta, 320, 1.5)];
    aoxianView.image=aoxian;
    [self.view addSubview:aoxianView];
    
    

}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
